package day6.Exer;

import java.util.Calendar;

public class Exer4 {
    public static void main(String[] args)  {
        Calendar a=Calendar.getInstance();
        a.set(2021,12-1,31);
        System.out.println("今年星期天的日期是：");
        for(int i=0;i<365;i++){
            a.add(Calendar.DAY_OF_YEAR,1);
            if(a.get(Calendar.DAY_OF_WEEK)==1){
                System.out.println((a.get(Calendar.MONTH)+1)+"月"+a.get(Calendar.DATE)+"日");
            }
        }
    }
}
